package com.weishaoying.example.base.conditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author WeiShaoying
 * @date 2018/4/4
 */
@Configuration
public class JavaConfig {

    @Bean
    @Conditional(WindowsCondition.class)
    public WindowsListCommand windowsListCommand() {
        return new WindowsListCommand();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public LinuxListCommand linuxListCommand() {
        return new LinuxListCommand();
    }
}
